<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
export default {
    mixins: [Vue.prototype.$vFN.Mixins.Base, Vue.prototype.$vFN.Mixins.Edit],
    components: {
        SelectImageRadio: async () =>
            Vue.extend(await Vue.prototype.$vFN.Components.Base.SelectImageRadio()),
    },
    data() {
        return {
            appWindow: window,
            form: {
                status: 1,
                cost_ratio: "",
                type: 1,
            },

        };
    },
    methods: {
        async setting() {
            let res = await this.$vFN.Http.post({
                url: "admin/integral/setting",
                data: {
                    id: this.id,
                    ...this.form,
                },
            }, window);
            if(res.code == 200) {
                this.onSuccess();
                this.mixinEdit_editVisible = false;
                this.$vFN.Tools.messageSuccess("操作成功");
            }
        },
        // 初始化
        async init() {
            this.form.status = this.data.status;
            this.form.type = this.data.type;
            this.form.cost_ratio = this.data.cost_ratio;
            // 显示窗口
            this.mixinEdit_editVisible = true;
        },

    },
    mounted() {
        this.init();
    },
    activated() {},
};
</script>